package com.knife.bbs.domain;

import java.util.HashMap;
import java.util.Map;
//关于type的定义：0-10公共活动参得分。发帖pm(0)、回帖rm(1)、点击click(2)、发表文章pa(3)，发表评论ra(5)，参与投票vote（6）,登录login，在线时间online
//11-20项目活动参与分:推荐会员introUser(11)、推荐网址introSite(12)、introOther其它推广(13)、work项目成员(16)、other其它  
//21-30其它加分 

public class Score {
	private String name;
	private int value;
	private static final Map scores = new HashMap();

	private static void init() {
		scores.put("intrUser", new Score("intrUser", 10));// 介绍用户
		scores.put("intrSite", new Score("intrSite", 5));// 连接进入
		scores.put("intrOther", new Score("intrOther", 5));// 介绍其它
		scores.put("work", new Score("work", 5));// 工作得分工协作
		scores.put("pm", new Score("pm", 3));// 发表帖子
		scores.put("rm", new Score("rm", 1));// 回复帖子
		scores.put("click", new Score("click", 1));// 点击数
		scores.put("pa", new Score("pa", 5));// 发表文章
		scores.put("ra", new Score("ra", 5));//
		scores.put("vote", new Score("vote", 5));
		scores.put("other", new Score("other", 5));
		scores.put("login", new Score("login", 1));
		scores.put("online", new Score("online", 1));
		scores.put("spreader", new Score("spreader", 1));
	}

	public static Score get(String name) {
		if (scores.isEmpty())
			init();
		return (Score) scores.get(name);
	}

	public Score() {

	}

	public Score(String name, int value) {
		this.name = name;
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}
}
